﻿//using System.Text;

//namespace WXWorkSvc.Common.TagHelpers;
//[HtmlTargetElement("weui-preview-item-list", Attributes = "asp-for-*", TagStructure = TagStructure.WithoutEndTag)]
//public class WeuiPreviewItemListTagHelper : TagHelper
//{
//    [HtmlAttributeName(DictionaryAttributePrefix = "asp-for-")]
//    public Dictionary<string, ModelExpression> Fors { get; set; } = new
//        Dictionary<string, ModelExpression>();

//    public override void Process(TagHelperContext context, TagHelperOutput output)
//    {
//        output.TagMode = TagMode.StartTagAndEndTag;
//        output.TagName = "div";
//        output.Attributes.AddClass("weui-form-preview__item");
//        StringBuilder sb = new StringBuilder();
//        foreach (var f in Fors.OrderBy(ii => ii.Key))
//        {
//            sb.AppendLine($""""
//                <label class="weui-form-preview__label">{f.Value.GetDisplayName()}</label>
//                <em class="weui-form-preview__value">{f.Value.Model}</em>
//                """");
//        }
//        output.Content.SetHtmlContent(sb.ToString());
//    }
//}
